﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ClassLibrary1.Enums

namespace ClassLibrary1
{
    public class TowerController
    {

        public List<BlockController> Blocks;
        public List<int> test;


        public void StartNewGame(int numberOfBlocks)
        {

            Blocks.Clear();
            for (int i = 0; i < numberOfBlocks; i++)
            {
                var Block = new BlockController();
                Block.Fade();
                Blocks.Add(Block);
            }
            ApplyRules();
        }

        public void processPick(BlockController playerPickedBlock)
        {

            var availableBlocks = Blocks.Where(block => block.Status == BlockStatus.Available).ToList();
            availableBlocks.ForEach(block => block.LockTouch = true);
            playerPickedBlock.Status = BlockStatus.Picked;
        }

        public void NextPick()
        {
            ApplyRules();
            var availableBlocks = Blocks.Where(block => block.Status == BlockStatus.Available).ToList();
            availableBlocks.ForEach(block => block.LockTouch = false);

        }

        public void KickNinja ()
        {
            var ninjaBlocks = Blocks;
        }


        public void ApplyRules()
        {
            // add rules to the blocks
        }



    }
}
